<!DOCTYPE html>
<html lang="zh-CN">
    <head>
		<meta charset="utf-8">
        <TITLE>vulscan 周扫描报表</TITLE>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/4.0.4/echarts-en.common.js"></script>
    </head>
    <body>
        <h1>本周共扫描了 {{ month_scan }} 次， 其中发现了 {{ month_vuls }} 个漏洞</h1>
        <h2>漏洞等级图表展示</h2>
        <div id="loudongdengji" style="width: 600px;height:400px;margin: 0 auto;"></div>
        <script type="text/javascript">
        	var myChart = echarts.init(document.getElementById('loudongdengji'));
	        option = {
			    title : {
			        text: '漏洞等级报表',
			        x:'center'
			    },
			    tooltip : {
			        trigger: 'item',
			        formatter: "{a} <br/>{b} : {c} ({d}%)"
			    },
			    legend: {
			        orient: 'vertical',
			        left: 'left',
			        data: ['严重', '高危', '中危']
			    },
			    series : [
			        {
			            name: '漏洞等级',
			            type: 'pie',
			            radius : '55%',
			            center: ['50%', '60%'],
			            data:[
			                {value: {{ month_cvss_yanzhong }}, name:'严重'},
			                {value: {{ month_cvss_gaowei }}, name:'高危'},
			                {value: {{ month_cvss_zhongwei }}, name:'中危'},
			               
			            ],
			            itemStyle: {
			                emphasis: {
			                    shadowBlur: 10,
			                    shadowOffsetX: 0,
			                    shadowColor: 'rgba(0, 0, 0, 0.5)'
			                }
			            }
			        }
			    ]
			};
			myChart.setOption(option);
		</script>
		<div id="loudongpaiming" style="width: 800px;height:400px;margin: 0 auto;"></div>
		<script type="text/javascript">
			var myChart = echarts.init(document.getElementById('loudongpaiming'));
			option = {
			    title: {
			        text: '漏洞排名',
			    },
			    tooltip: {
			        trigger: 'axis',
			        axisPointer: {
			            type: 'shadow'
			        }
			    },
			    grid: {
			        left: '3%',
			        right: '4%',
			        bottom: '3%',
			        containLabel: true
			    },
			    xAxis: {
			        type: 'value',
			        boundaryGap: [0, 0.01]
			    },
			    yAxis: {
			        type: 'category',
			        data: [{% for v in paiming %} "{{ v.checkpoint }}",{% endfor %}]
						},
			    series: [
			        {
			            name: '出现次数',
			            type: 'bar',
			            data: [{% for v in paiming %} "{{ v.num_poc }}",{% endfor %}]
								},
				    ]
				};
			myChart.setOption(option);
		</script>
    </body>
</html>
